package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.imaster.enumeration.CheckEmployeeStatusEnum;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 实体类
 * 公司审核用户表
 * </p>
 *
 * @author ligang
 * @since 2021-08-31
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("com_check_employee")
@ApiModel(value = "CheckEmployee", description = "公司审核用户表")
@AllArgsConstructor
public class CheckEmployee extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID")
    @TableField(value = "company_id")
    @Excel(name = "公司ID")
    private Long companyId;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @TableField(value = "user_account_id")
    @Excel(name = "用户ID")
    private Long userAccountId;

    /**
     * 是否为管理员
     */
    @ApiModelProperty(value = "是否为管理员")
    @TableField(value = "is_admin")
    @Excel(name = "是否为管理员")
    private Integer isAdmin;

    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 状态#{normal:正常;checking:审核中;check_succ:审核成功;check_fail:审核失败}
     */
    @ApiModelProperty(value = "状态#{normal:正常;checking:审核中;check_succ:审核成功;check_fail:审核失败}")
    @TableField(value = "status")
    @Excel(name = "状态#{normal:正常;checking:审核中;check_succ:审核成功;check_fail:审核失败}", replace = {"正常_NORMAL", "审核中_CHECKING", "审核成功_CHECK_SUCC", "审核失败_CHECK_FAIL",  "_null"})
    private CheckEmployeeStatusEnum status;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enabled")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnabled;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDeleted;


    @Builder
    public CheckEmployee(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long companyId, Long userAccountId, Integer isAdmin, Long projectId, CheckEmployeeStatusEnum status, 
                    Integer isEnabled, Integer isDeleted) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.companyId = companyId;
        this.userAccountId = userAccountId;
        this.isAdmin = isAdmin;
        this.projectId = projectId;
        this.status = status;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
    }

}
